package CCF_2014;

import java.util.Arrays;
import java.util.Scanner;

public class T201403_1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.valueOf(scanner.nextLine());
        int nums[] = StringToInt(scanner.nextLine().split(" "));
        scanner.close();
        Arrays.sort(nums);
        int count=0,i=0,j=n-1;
        while(i<n && nums[i] < 0 && nums[j] > 0 && j>i) {
            if (-nums[i] == nums[j]) {
                count++;
                i++;
                j--;
            } else if (-nums[i] > nums[j]) {
                i++;
            } else {
                j--;
            }
        }
        System.out.print(count);
    }

    private static int[] StringToInt(String ss[]) {
        int array[] = new int[ss.length];
        for (int i=0;i<ss.length;i++) {
            array[i] = Integer.valueOf(ss[i]);
        }
        return array;
    }
}
